/* ===================================================================
   价格管理模态框样式
   基于Apple Design System
   文件：pricing-modal.css
=================================================================== */

/* 价格管理模态框 */
.pricing-modal {
    width: 90vw;
    max-width: 1200px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.pricing-modal .modal-body {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 价格概览 */
.pricing-overview {
    padding: var(--spacing-6);
    border-bottom: 1px solid var(--separator-non-opaque);
    background-color: var(--system-background-secondary);
}

.product-info-card {
    display: flex;
    gap: var(--spacing-6);
    align-items: flex-start;
}

.product-basic-info {
    display: flex;
    gap: var(--spacing-4);
    align-items: center;
    flex: 1;
}

.product-image {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-medium);
}

.product-details {
    flex: 1;
}

.product-name {
    font-size: var(--font-size-headline);
    font-weight: var(--font-weight-semibold);
    color: var(--label-primary);
    margin-bottom: var(--spacing-2);
}

.product-code {
    font-size: var(--font-size-subhead);
    color: var(--label-secondary);
    font-family: var(--font-family-mono);
    margin-bottom: var(--spacing-2);
}

.product-category {
    display: flex;
    gap: var(--spacing-2);
    align-items: center;
}

.category-tag, .destination-tag {
    padding: var(--spacing-1) var(--spacing-2);
    border-radius: var(--radius-full);
    font-size: var(--font-size-caption-1);
    font-weight: var(--font-weight-medium);
}

.category-tag {
    background-color: rgba(0, 122, 255, 0.1);
    color: var(--apple-blue);
}

.destination-tag {
    background-color: var(--fill-secondary);
    color: var(--label-secondary);
}

.pricing-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-4);
    min-width: 300px;
}

.stat-item {
    text-align: center;
}

.stat-label {
    font-size: var(--font-size-caption-1);
    color: var(--label-secondary);
    margin-bottom: var(--spacing-1);
}

.stat-value {
    font-size: var(--font-size-title-3);
    font-weight: var(--font-weight-semibold);
    color: var(--label-primary);
}

.stat-value.primary {
    color: var(--apple-blue);
}

.stat-value.success {
    color: var(--apple-green);
}

/* 价格管理标签页 */
.pricing-tabs {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tab-navigation {
    display: flex;
    border-bottom: 1px solid var(--separator-non-opaque);
    background-color: var(--system-background);
}

.tab-btn {
    flex: 1;
    padding: var(--spacing-4);
    background: none;
    border: none;
    font-size: var(--font-size-subhead);
    font-weight: var(--font-weight-medium);
    color: var(--label-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    border-bottom: 2px solid transparent;
}

.tab-btn:hover {
    color: var(--label-primary);
    background-color: var(--fill-quaternary);
}

.tab-btn.active {
    color: var(--apple-blue);
    border-bottom-color: var(--apple-blue);
}

.tab-content {
    flex: 1;
    overflow-y: auto;
}

.tab-pane {
    display: none;
    padding: var(--spacing-6);
}

.tab-pane.active {
    display: block;
}

/* 当前价格表单 */
.pricing-form {
    max-width: none;
}

.form-section {
    margin-bottom: var(--spacing-8);
}

.form-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: var(--font-size-title-3);
    font-weight: var(--font-weight-semibold);
    color: var(--label-primary);
    margin-bottom: var(--spacing-4);
    padding-bottom: var(--spacing-2);
    border-bottom: 1px solid var(--separator-non-opaque);
}

.price-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-4);
}

.price-item {
    display: flex;
    flex-direction: column;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix {
    position: absolute;
    left: var(--spacing-3);
    color: var(--label-secondary);
    font-size: var(--font-size-body);
    z-index: 1;
}

.input-group .form-input {
    padding-left: var(--spacing-8);
}

.input-suffix {
    position: absolute;
    right: var(--spacing-3);
    color: var(--label-secondary);
    font-size: var(--font-size-body);
}

.input-group .form-input:has(~ .input-suffix) {
    padding-right: var(--spacing-8);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-4);
}

/* 季节价格管理 */
.seasonal-pricing {
    max-width: none;
}

.season-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-6);
}

.season-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-6);
}

.season-item {
    background-color: var(--system-background-secondary);
    border-radius: var(--radius-large);
    padding: var(--spacing-6);
    border: 1px solid var(--separator-non-opaque);
    position: relative;
}

.season-item.special {
    border-color: var(--apple-orange);
    background-color: rgba(255, 149, 0, 0.05);
}

.season-header-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    margin-bottom: var(--spacing-4);
}

.season-name {
    font-size: var(--font-size-headline);
    font-weight: var(--font-weight-semibold);
    color: var(--label-primary);
    margin: 0;
}

.season-period {
    font-size: var(--font-size-subhead);
    color: var(--label-secondary);
}

.special-badge {
    padding: var(--spacing-1) var(--spacing-2);
    background-color: var(--apple-orange);
    color: white;
    font-size: var(--font-size-caption-1);
    font-weight: var(--font-weight-medium);
    border-radius: var(--radius-full);
}

.season-pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-4);
    margin-bottom: var(--spacing-4);
}

.season-actions {
    position: absolute;
    top: var(--spacing-4);
    right: var(--spacing-4);
    display: flex;
    gap: var(--spacing-2);
}

/* 动态价格规则 */
.dynamic-pricing {
    max-width: none;
}

.rules-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-6);
}

.rule-category {
    background-color: var(--system-background-secondary);
    border-radius: var(--radius-large);
    padding: var(--spacing-6);
}

.category-title {
    font-size: var(--font-size-headline);
    font-weight: var(--font-weight-semibold);
    color: var(--label-primary);
    margin-bottom: var(--spacing-4);
}

.rule-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-4);
}

.rule-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-4);
    background-color: var(--system-background);
    border-radius: var(--radius-medium);
    border: 1px solid var(--separator-non-opaque);
}

.rule-condition {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    flex: 1;
}

.condition-label {
    font-size: var(--font-size-body);
    color: var(--label-primary);
}

.toggle-switch {
    position: relative;
    display: inline-block;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-label {
    position: relative;
    display: block;
    width: 44px;
    height: 24px;
    background-color: var(--fill-secondary);
    border-radius: 12px;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.toggle-label:before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: transform var(--transition-fast);
    box-shadow: var(--shadow-small);
}

.toggle-switch input:checked + .toggle-label {
    background-color: var(--apple-blue);
}

.toggle-switch input:checked + .toggle-label:before {
    transform: translateX(20px);
}

.rule-config {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
}

.discount-input {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
}

.discount-input label {
    font-size: var(--font-size-subhead);
    color: var(--label-secondary);
    white-space: nowrap;
}

.discount-input .form-input {
    width: 80px;
    text-align: center;
}

/* 价格分析 */
.price-analysis {
    max-width: none;
}

.analysis-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-6);
    margin-bottom: var(--spacing-8);
}

.analysis-card {
    background-color: var(--system-background-secondary);
    border-radius: var(--radius-large);
    padding: var(--spacing-6);
}

.card-title {
    font-size: var(--font-size-headline);
    font-weight: var(--font-weight-semibold);
    color: var(--label-primary);
    margin-bottom: var(--spacing-4);
}

.competitiveness-score {
    display: flex;
    align-items: center;
    gap: var(--spacing-6);
}

.score-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: conic-gradient(var(--apple-blue) 0deg, var(--apple-blue) 295deg, var(--fill-tertiary) 295deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.score-circle:before {
    content: "";
    position: absolute;
    width: 60px;
    height: 60px;
    background-color: var(--system-background-secondary);
    border-radius: 50%;
}

.score-number {
    font-size: var(--font-size-title-3);
    font-weight: var(--font-weight-bold);
    color: var(--apple-blue);
    z-index: 1;
}

.score-label {
    font-size: var(--font-size-caption-1);
    color: var(--label-secondary);
    z-index: 1;
}

.score-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-3);
}

.score-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
}

.score-name {
    font-size: var(--font-size-subhead);
    color: var(--label-secondary);
    min-width: 60px;
}

.score-bar {
    flex: 1;
    height: 6px;
    background-color: var(--fill-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background-color: var(--apple-blue);
    transition: width var(--transition-normal);
}

.bar-fill.success {
    background-color: var(--apple-green);
}

.bar-fill.warning {
    background-color: var(--apple-orange);
}

.score-value {
    font-size: var(--font-size-subhead);
    font-weight: var(--font-weight-medium);
    color: var(--label-primary);
    min-width: 30px;
    text-align: right;
}

.competitor-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-3);
}

.competitor-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-3);
    background-color: var(--system-background);
    border-radius: var(--radius-medium);
}

.competitor-name {
    font-size: var(--font-size-subhead);
    color: var(--label-primary);
}

.competitor-price {
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-semibold);
    color: var(--label-primary);
}

.price-diff {
    font-size: var(--font-size-caption-1);
    font-weight: var(--font-weight-medium);
}

.price-diff.positive {
    color: var(--apple-green);
}

.price-diff.negative {
    color: var(--apple-red);
}

.analysis-recommendations {
    margin-bottom: var(--spacing-8);
}

.recommendation-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-4);
}

.recommendation-item {
    display: flex;
    gap: var(--spacing-4);
    padding: var(--spacing-4);
    background-color: var(--system-background-secondary);
    border-radius: var(--radius-medium);
}

.recommendation-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--font-size-body);
}

.recommendation-icon.success {
    background-color: var(--apple-green);
}

.recommendation-icon.warning {
    background-color: var(--apple-orange);
}

.recommendation-icon.info {
    background-color: var(--apple-blue);
}

.recommendation-content {
    flex: 1;
}

.recommendation-title {
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-semibold);
    color: var(--label-primary);
    margin-bottom: var(--spacing-1);
}

.recommendation-desc {
    font-size: var(--font-size-subhead);
    color: var(--label-secondary);
    line-height: 1.4;
}

.sales-data {
    background-color: var(--system-background-secondary);
    border-radius: var(--radius-large);
    padding: var(--spacing-6);
}

.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-4);
}

.data-item {
    text-align: center;
    padding: var(--spacing-4);
    background-color: var(--system-background);
    border-radius: var(--radius-medium);
}

.data-label {
    font-size: var(--font-size-caption-1);
    color: var(--label-secondary);
    margin-bottom: var(--spacing-2);
}

.data-value {
    font-size: var(--font-size-title-2);
    font-weight: var(--font-weight-bold);
    color: var(--label-primary);
    margin-bottom: var(--spacing-1);
}

.data-trend {
    font-size: var(--font-size-caption-1);
    font-weight: var(--font-weight-medium);
}

.data-trend.positive {
    color: var(--apple-green);
}

.data-trend.negative {
    color: var(--apple-red);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .pricing-modal {
        width: 95vw;
        max-height: 95vh;
    }
    
    .product-info-card {
        flex-direction: column;
        gap: var(--spacing-4);
    }
    
    .pricing-stats {
        grid-template-columns: repeat(4, 1fr);
        min-width: auto;
    }
    
    .tab-navigation {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: none;
        min-width: 120px;
    }
    
    .price-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .season-pricing-grid {
        grid-template-columns: 1fr;
    }
    
    .analysis-cards {
        grid-template-columns: 1fr;
    }
    
    .competitiveness-score {
        flex-direction: column;
        text-align: center;
    }
    
    .data-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .tab-pane {
        padding: var(--spacing-4);
    }
    
    .pricing-overview {
        padding: var(--spacing-4);
    }
    
    .price-grid {
        grid-template-columns: 1fr;
    }
    
    .pricing-stats {
        grid-template-columns: 1fr 1fr;
    }
    
    .data-grid {
        grid-template-columns: 1fr;
    }
    
    .rule-item {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-3);
    }
    
    .rule-condition {
        justify-content: space-between;
    }
    
    .rule-config {
        justify-content: center;
    }
}